Skip to content

Teams 2#123

Merged
sezanzeb merged 37 commits intomainfrom
teams2
Apr 13, 2026
Merged

Teams 2#123
sezanzeb merged 37 commits intomainfrom
teams2

Conversation

@sezanzeb
Copy link
Copy Markdown
Collaborator

@sezanzeb sezanzeb commented Apr 8, 2026

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR appears to implement a revamped “Teams” model (single team per user, explicit team owner, join requests, remove members, set owner) across backend + frontend, and reorganizes the README into separate docs with updated UI messaging.

Changes:

  • Refactors backend team membership from string arrays to ORM relations (Team.owner, User.team, User.teamRequest) and adds endpoints for removing members / setting owner.
  • Updates frontend team pages (new EditTeam page, request-to-join UX, notifications) and adjusts project/rating gating based on team membership/admission.
  • Moves large README content into docs/docs.md and adds new screenshots/docs updates.

Reviewed changes

Copilot reviewed 36 out of 38 changed files in this pull request and generated 14 comments.

Show a summary per file
File Description
README.md Simplifies landing README and links to new docs and quickstart.
frontend/test/mocks/api.ts Extends mocked API to include new team methods.
frontend/src/components/routers/sidebar/sidebar.tsx Updates sidebar copy.
frontend/src/components/pages/view-team.tsx Wires new EditTeam component with reload callback.
frontend/src/components/pages/view-project.tsx Updates membership check and adds save notifications.
frontend/src/components/pages/teams.tsx Updates team page explanatory copy.
frontend/src/components/pages/status.tsx Updates status page copy for teams.
frontend/src/components/pages/read-only-team.tsx Updates read-only team view, join request flow, and member display.
frontend/src/components/pages/read-only-project.tsx Uses fallback project image and gates rating UI to admitted users.
frontend/src/components/pages/rating-form.tsx Refactors rating form layout to use StackWithBorder.
frontend/src/components/pages/edit-team.tsx Adds new team edit UI (accept requests, remove members, set owner, delete team).
frontend/src/components/pages/createTeam.tsx Simplifies team creation and blocks creating when already in a team.
frontend/src/components/pages/admission.tsx Contains partial updates related to teams in admissions table.
frontend/src/components/base/stack-with-border.tsx Adds a reusable bordered stack UI component.
frontend/src/components/base/button.tsx Adds nowrap styling and allows passing inline styles into Button.
frontend/src/api/index.ts Updates team API shapes and adds removeUserFromTeam / setOwner.
docs/screenshot-1.jpg Adds/updates documentation screenshot asset.
docs/docs.md Adds new extracted documentation content from README.
docs/docker-development.md Adds a yarn audit command to the lint section.
backend/test/services/team-service.spec.ts Updates team creation test for new team/user relationship.
backend/test/services/rating-service.spec.ts Updates setup for new teams and adds rating value validation tests.
backend/test/services/project-service.spec.ts Updates setup for new team/user relationship.
backend/test/services/project-service-get-all-projects.spec.ts Updates project visibility tests for “single team per user” model.
backend/test/services/mock/mock-teams-service.ts Extends team service mock with new methods.
backend/test/controllers/rating-controller.spec.ts Removes old rating controller test suite.
backend/test/controllers/auth.spec.ts Adds auth/role and “no sensitive fields” HTTP-level tests.
backend/src/utils/has-same-elements.ts Adds a new array utility function.
backend/src/services/user-service.ts Changes user retrieval contract and updates user list DTO shape.
backend/src/services/team-service.ts Implements new team model operations (create, update, request, accept, remove, set owner).
backend/src/services/rating-service.ts Adds team membership requirement and updates team membership check logic.
backend/src/services/project-service.ts Updates project visibility/permission logic to use user.team?.id.
backend/src/services/application-service.ts Removes “teams” from application response building.
backend/src/entities/user.ts Adds team and teamRequest relations on User.
backend/src/entities/team.ts Refactors team entity to relations and adds helper ID extraction methods.
backend/src/controllers/users-controller.ts Adjusts login/refresh behavior (and message) and relies on DTO conversion.
backend/src/controllers/dto.ts Extends DTOs for team/teamRequest and refactors team DTO shapes.
backend/src/controllers/application-controller.ts Updates createTeam signature and adds removeMember / setOwner endpoints.
Comments suppressed due to low confidence (3)

frontend/src/components/pages/read-only-team.tsx:45

  • Team ownership is still derived from team.users?.[0] even though ownership is now modeled as team.owner. This will misidentify the owner (and breaks if users aren’t ordered). Use team.owner?.id for the owner check.
    backend/src/services/team-service.ts:260
  • Deleting the team without clearing users’ team / teamRequest references is likely to violate the DB foreign key constraints (or leave orphaned references, depending on configuration). Before delete, update affected users to team: null / teamRequest: null (or configure onDelete: "SET NULL" on the relations).
    if (team?.owner.id !== currentUserId.id) {
      throw new Error("You are not the owner of this team");
    }

    await this._teams.delete(id);

    return Promise.resolve();

backend/src/controllers/dto.ts:535

  • ApplicationDTO still exposes a teams: string[] field, but ApplicationService.getAll() no longer sets it (and the IApplication interface removed teams). This makes the API response inconsistent and leads to teams being undefined on the frontend. Either remove teams from the DTO/clients or reintroduce/populate it consistently.
export class ApplicationDTO {
  @Expose()
  @Type(() => UserDTO)
  public user!: UserDTO;
  @Expose()
  public teams!: string[];
  @Expose()

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread frontend/src/components/pages/read-only-team.tsx Outdated
Comment thread frontend/src/components/pages/edit-team.tsx Outdated
Comment thread frontend/src/components/pages/edit-team.tsx Outdated
Comment thread frontend/src/components/pages/edit-team.tsx Outdated
Comment thread backend/src/services/team-service.ts Outdated
Comment thread backend/src/controllers/dto.ts Outdated
Comment thread backend/src/controllers/users-controller.ts Outdated
Comment thread frontend/src/api/index.ts
Comment thread backend/src/utils/has-same-elements.ts Outdated
Comment thread backend/src/entities/user.ts Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 37 out of 39 changed files in this pull request and generated 9 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread backend/src/entities/project.ts Outdated
Comment thread backend/src/entities/team.ts
Comment thread frontend/src/components/base/stack-with-border.tsx
Comment thread frontend/src/components/base/button.tsx Outdated
Comment thread frontend/src/components/pages/edit-team.tsx Outdated
Comment thread backend/src/services/rating-service.ts
Comment thread frontend/src/components/pages/view-team.tsx Outdated
Comment thread README.md
Comment thread docs/docs.md Outdated
sezanzeb and others added 8 commits April 12, 2026 23:12
* test: add tests for all TODO test comments

Agent-Logs-Url: https://github.com/hackaburg/tilt/sessions/7c7127d4-6d01-41ef-a09c-77b78c39886d

Co-authored-by: sezanzeb <28510156+sezanzeb@users.noreply.github.com>

* chore: remove // TODO test comments now covered by tests

Agent-Logs-Url: https://github.com/hackaburg/tilt/sessions/0ea22aa8-e99a-4fdb-9faf-330de9442742

Co-authored-by: sezanzeb <28510156+sezanzeb@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: sezanzeb <28510156+sezanzeb@users.noreply.github.com>
@sezanzeb sezanzeb merged commit 76f6022 into main Apr 13, 2026
4 checks passed
@sezanzeb sezanzeb deleted the teams2 branch April 13, 2026 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants